<?php

/*

	the original spTable is getting very messy... going to attempt to make a cleaner version that supports:
	
		caption : 1 caption
			the caption is a child of the table element
			<caption>Some Caption Text here</caption>
		
		header	: 1 header
			the header is a child of the table element
			<thead>
				<tr>
					<th>one</th>
					<th>two</th>
				</tr>
			</thead>
		
		footer	: 1 footer
			the footer is a child of the table element
			<tfoot>
				<tr>
					<td>one</td>
					<td>two</td>
				</tr>
			</tfoot>
		
		body	: many bodies
			all bodies are a child of the table element
			<tbody>
				<tr>
					<td>one</td>
					<td>two</td>
				</tr>
			</tbody>
*/

class spTable2 extends spElement
{
	private $style_td = null;

	public function __construct( $param=null )
	{
		parent::__construct( "table", $param );
	}
	
	public function createCaption( $text="" )
	{
		$caption = new spCaption(array(
			"content" => $text
		));
		parent::addChild( $caption );
		return $caption;
	}
	
	public function createHeader( $param=null )
	{
		$thead = new spTableHeader( $param );
		parent::addChild( $thead );
		return $thead;
	}
	
	public function createFooter()
	{
		$tfoot = new spTableFooter;
		parent::addChild( $tfoot );
		return $tfoot;
	}
	
	public function addBody( $param=null )
	{
		$tbody = new spTableBody( $param );
		parent::addChild( $tbody );
		return $tbody;
	}

}

?>